import { ToolTipItem } from "../../../../../com/mui/manager/ToolTipItem";
import { MountUtil } from "../../../scene/mount/MountUtil";
import { LoaderHelp } from "../../../../common/display/LoaderHelp";
import { ResFileConst } from "../../../resource/ResFileConst";
import { ItemData } from "../../../resource/info/ItemData";
import { Cache } from "../../../cache/Cache";
import { CareerUtil } from "../../common/util/CareerUtil";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../../extend/language/Language";
import { GlobalStyle } from "../../../../common/global/GlobalStyle";
//class MountTileItem
    
    export  class MountTileItem extends ToolTipItem
    {
        constructor()
        {
            super();
            this.initView();
            return;
        }

        /* internal  */initView(): void
        {
            this._gradeBm = new Object /* flash.display.Bitmap */();
            addChild(this._gradeBm);
            this.dic = MountUtil.instance.getSpecialGradGrowValue();
            LoaderHelp.addResCallBack(ResFileConst.mount, this.onLoadBmResource);
            return;
        }

        /* internal  */onLoadBmResource(): void
        {
            this._load = true;
            if (this._idata) 
            {
                this.setData(this._idata);
            }
            return;
        }

        public setData(arg1: ItemData): void
        {
            if (!arg1) 
            {
                this._gradeBm.bitmapData = null;
                return;
            }
            this._idata = arg1;
            if (!this._load) 
            {
                return;
            }
            var loc1=MountUtil.instance.getSpecialGradGrowLevel();
            MountUtil.setMountNameBitmap(arg1.itemExInfo.m_adv_lv, this._gradeBm);
            var loc2=Cache.instance.role.careerBasic;
            if (CareerUtil.isPhysicalCareer(loc2)) 
            {
                this.toolTipData = HTMLUtil.addColor(Language.getStringByParam(71522, loc1[0], this.dic[0]) + Language.getStringByParam(71523, loc1[1], this.dic[1]) + Language.getStringByParam(71524, loc1[2], this.dic[2]) + Language.getStringByParam(71543, loc1[3], this.dic[3]) + Language.getStringByParam(71560, loc1[4], this.dic[4]), GlobalStyle.color1);
            }
            else if (CareerUtil.isMagicCareer(loc2)) 
            {
                this.toolTipData = HTMLUtil.addColor(Language.getStringByParam(71539, loc1[0], this.dic[0]) + Language.getStringByParam(71540, loc1[1], this.dic[1]) + Language.getStringByParam(71541, loc1[2], this.dic[2]) + Language.getStringByParam(71544, loc1[3], this.dic[3]) + Language.getStringByParam(71561, loc1[4], this.dic[4]), GlobalStyle.color1);
            }
            else 
            {
                this.toolTipData = HTMLUtil.addColor(Language.getString(71542), GlobalStyle.color1);
            }
            return;
        }

        /* internal */ /* var */_gradeBm: Object /* flash.display.Bitmap */;

        /* internal */ /* var */dic: Array<any>;

        /* internal */ /* var */_idata: ItemData;

        /* internal */ /* var */_load: Boolean;
    }
